package com.dotflat.fin.cnst;

/**
 * 产品类型
 * @date ：Created in 11/6/2020 3:15 PM
 */
public enum ProductTypeEnum {
    //    @Column(columnDefinition = "int default 1 COMMENT '类型 1：托班，2:早教，3：其它  4：摄像头  5：订金'")
    NURSERY(1, "托班"),
    EARLY(2, "早教"),
    OTHER(3, "其它"),
    CAMERA(4, "摄像头"),
    DEPOSIT(5,"订金");

    private String value;
    private Integer code;

    ProductTypeEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public Integer getCode() {
        return code;
    }

    public static ProductTypeEnum get(Integer code){
        if (code == null){
            return null;
        }

        for (ProductTypeEnum t : values() ) {
            if (t.getCode() == code)
                return t;
        }
        return null;
    }
}
